﻿//-------------------------------------------------------------------------------------------------
// <copyright file="RaceHandlers.cs" company="Anthony Adam">
// Copyright (c) Anthony Adam 2012. All rights reserved.
// </copyright>
//-------------------------------------------------------------------------------------------------
// ReSharper disable once CheckNamespace
namespace SuperStarRounds
{
  using System.Windows.Forms;

  /// <summary>
  /// Utility class containing the skill choice control population functions.
  /// </summary>
  public static class RaceHandlers
  {

    /// <summary>
    /// Sets the current content selected in the application using the check marks
    /// on the select content check boxes tab.
    /// </summary>
    /// <param name="includeCore">true selects core rules content</param>
    /// <param name="includeAdvanced">true selects advanced players guide content</param>
    /// <param name="includeMagic">true selects ultimate magic content</param>
    /// <param name="includeCombat">true selects ultimate combat content</param>
    /// <param name="comboBox">The choice control to be populated</param>
    public static void SetRaceList(bool includeCore, bool includeAdvanced, bool includeMagic, bool includeCombat, ComboBox comboBox)
    {
      comboBox.Items.Clear();

      // TODO: include other races

      AddRace(includeCore, comboBox, "Human");

      if (comboBox.Items.Count > 0)
        comboBox.SelectedIndex = 0;
      else
        comboBox.Text = string.Empty;
    }

    private static void AddRace(bool addIt, ComboBox comboBox, string race)
    {
      if (!addIt) return;

      comboBox.Items.Add(race);
    }
  }
}